package com.share.device.service.impl;

import java.util.List;
import com.share.common.core.utils.DateUtils;
import com.share.device.domain.DeviceStatusLog;
import com.share.device.mapper.DeviceStatusLogMapper;
import com.share.device.service.IDeviceStatusLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 设备状态日志Service业务层处理
 *
 * @author         
 * @date 2025-06-24
 */
@Service
public class DeviceStatusLogServiceImpl implements IDeviceStatusLogService
{
    @Autowired
    private DeviceStatusLogMapper deviceStatusLogMapper;

    /**
     * 查询设备状态日志
     *
     * @param logId 设备状态日志主键
     * @return 设备状态日志
     */
    @Override
    public DeviceStatusLog selectDeviceStatusLogById(Long logId)
    {
        return deviceStatusLogMapper.selectDeviceStatusLogById(logId);
    }

    /**
     * 查询设备状态日志列表
     *
     * @param deviceStatusLog 设备状态日志
     * @return 设备状态日志
     */
    @Override
    public List<DeviceStatusLog> selectDeviceStatusLogList(DeviceStatusLog deviceStatusLog)
    {
        return deviceStatusLogMapper.selectDeviceStatusLogList(deviceStatusLog);
    }

    /**
     * 新增设备状态日志
     *
     * @param deviceStatusLog 设备状态日志
     * @return 结果
     */
    @Override
    public int insertDeviceStatusLog(DeviceStatusLog deviceStatusLog)
    {
        deviceStatusLog.setCreateTime(DateUtils.getNowDate());
        return deviceStatusLogMapper.insertDeviceStatusLog(deviceStatusLog);
    }

    /**
     * 修改设备状态日志
     *
     * @param deviceStatusLog 设备状态日志
     * @return 结果
     */
    @Override
    public int updateDeviceStatusLog(DeviceStatusLog deviceStatusLog)
    {
        return deviceStatusLogMapper.updateDeviceStatusLog(deviceStatusLog);
    }

    /**
     * 批量删除设备状态日志
     *
     * @param logIds 需要删除的设备状态日志主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusLogByIds(Long[] logIds)
    {
        return deviceStatusLogMapper.deleteDeviceStatusLogByIds(logIds);
    }

    /**
     * 删除设备状态日志信息
     *
     * @param logId 设备状态日志主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusLogById(Long logId)
    {
        return deviceStatusLogMapper.deleteDeviceStatusLogById(logId);
    }
} 